package newfeature.jdk8;

/**
 * Created by dl
 */
public class InterfaceDefaultMethod {

	public static void main(String[] args) {
		System.out.println("are-you-ok: "+new OkImpl().areYouOk());
		System.out.println("are-you-ok: "+new NotOkImpl().areYouOk());
	}

	interface AreYouOk{
		default boolean areYouOk() {		// a default implementation
			return true;
		}
	}

	static class OkImpl implements AreYouOk{
	}

	static class NotOkImpl implements AreYouOk {
		@Override
		public boolean areYouOk() {
			return false;
		}
	}

}
